<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body></body>
</html>
<script>
    const links = [];
    const str = `
        https://www.baidu.com 百度一下，你就知道<br/>
        http://www.google.com/ 谷歌搜索<br/>
        http://www.taobao.com/ 淘宝网
    `;
    const reg = /(?<link>https?:\/\/(?<title>\w+\.\w+\.(com|cn|net)))/gi;
    str.matchAll(reg).forEach((item) => {
        links.push(item.groups);
    });
    console.dir(links);
</script>
